#!/usr/bin/env python
# coding=utf-8
import sys
import matplotlib.pyplot as plt
import numpy as np
import math

def readfile(filename):
    fp=open(filename)
    data=fp.readlines()

    x=[]
    y=[]

    for line in data:
        yang=line.split('\t')
        x.append(float(yang[1]) - 22859.81753)
        y.append(float(yang[2]) - 33414.07555)
    
    return x,y

def readlog(filename):
    fp=open(filename)
    data=fp.readlines()

    x=[]
    y=[]

    for line in data:
        yang=line.split('\t')
        x1=math.cos(0.588558)*float(yang[1])-math.sin(0.588558)*float(yang[2])
        y1=math.sin(0.588558)*float(yang[1])+math.cos(0.588558)*float(yang[2])
        x.append(x1)
        y.append(y1)
    return x,y

if __name__ == '__main__':

    x1,y1=readfile(sys.argv[1])
    x2,y2=readlog(sys.argv[2])
    plt.figure('Draw')
    plt.scatter(x1,y1,c='y')
    plt.scatter(x2,y2,c='r')
    plt.show()
